package com.mz.ozy.mvp.model;

import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

public class BindPhoneModel {

    /**
     * @param context
     * @param type        1-微信  2-支付宝
     * @param mobilePhone 手机号
     * @param code        验证码
     * @param id          微信-unionId，支付宝-userid
     * @return
     */
    public Observable<ResponseBody> onBind(Context context, int type, String mobilePhone, String code
            , String id) {
        HashMap<String, String> map = new HashMap<>();
        map.put("type", type + "");
        map.put("mobilePhone", mobilePhone);
        map.put("code", code);
        map.put("id", id);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10064, JsonUtils.requestJsonDate(map), Constants.tokenId);
    }

}